<template>
	<view class="ass-page">
		<view class="content">
			<view class="box">
				<view class="price_row">
					<text class="status_tip">退款金额</text>
					<text class="pay_val">￥<text class="price">{{info.refund_price}}</text></text>
				</view>
				<view class="pay_row">
					<text class="pay_lbl">支付渠道</text>
					<text class="pay_val">微信</text>
				</view>
				<view class="pay_row">
					<text class="pay_lbl">退款账户</text>
					<text class="pay_val cgreen">微信账号 soojop</text>
				</view>
			</view>
			<uv-gap height="10" bgColor="transparent" />
			<view class="box">
				<view class="logistics-timeline">
					<view class="timeline-item">
						<!-- 时间轴节点 -->
						<view class="timeline-node"></view>
						<!-- 时间轴内容 -->
						<view class="timeline-content">
							<view class="logistics-header">
								<span class="status-text"
									>到账成功</span>
								<span class="time-text">2025-08-18 09:30:08</span>
							</view>
							<view class="logistics-detail">
								<view>已推到您的微信钱包，到账时间以处理时间为准</view>
							</view>
						</view>
					</view>
					<view class="timeline-item">
						<!-- 时间轴节点 -->
						<view class="timeline-node active"></view>
						<!-- 时间轴内容 -->
						<view class="timeline-content">
							<view class="logistics-header">
								<span class="status-text active"
									>商家同意申请</span>
								<span class="time-text">2025-08-18 09:30:05</span>
							</view>
							<view class="logistics-detail">
								<view>收到退货包裹后商家会及时处理退款哦</view>
							</view>
						</view>
					</view>
					<view class="timeline-item">
						<!-- 时间轴节点 -->
						<view class="timeline-node active"></view>
						<!-- 时间轴内容 -->
						<view class="timeline-content">
							<view class="logistics-header">
								<span class="status-text active"
									>客户发起退货退款</span>
								<span class="time-text">2025-08-18 09:30:05</span>
							</view>
							<view class="logistics-detail">
								<view>系统会在1-2天内处理</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<uv-gap height="10" bgColor="transparent" />
			<view class="box">
				<view class="pay_row">
					<text class="pay_lbl">退货运费</text>
					<text class="pay_val">￥<text class="price1">{{info.refund_express_prices}}</text></text>
				</view>
				<view class="pay_row" @click="goLogistics">
					<text class="pay_lbl">退货物流：<text class="c333">{{info.refund_express_name}} {{info.refund_express}}</text></text>
					<uv-icon name="arrow-right" size="12" color="#979797"/>
				</view>
			</view>
			<uv-gap height="10" bgColor="transparent" />
			<view class="box">
				<view class="flex">
					<image :src="info.product_image" class="thumb" />
					<view class="flex-1 flex align-start justify-between">
						<view class="skus">
							<text class="pName">{{info.product_name}}</text>
							<uv-gap height="5" bgColor="transparent" v-if="info.spec_values" />
							<view class="tags" v-if="info.spec_values">{{info.spec_values}}</view>
						</view>
					</view>
				</view>
				<view class="order-info">
					<view class="orderNo">
						<view class="lbl_pay">订单编号：</view>{{info.order_no}}
					</view>
					<uv-button size="mini" type="primary" plain @click="copyOrderNo" style="margin-left: 10px;">
						复制
					</uv-button>
				</view>
				<view class="order-info1">
					<view class="lbl_pay">退货数量：</view>
					<view class="pay_info">1</view>
				</view>
				<view class="order-info1">
					<view class="lbl_pay">申请金额：</view>
					<view class="pay_info">￥33.33</view>
				</view>
				<view class="order-info1">
					<view class="lbl_pay">退款原因：</view>
					<view class="pay_info">不想要了</view>
				</view>
				<view class="order-info1">
					<view class="lbl_pay">申请时间：</view>
					<view class="pay_info">2025-08-18 09:00:05</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import {
		getGoodsAfterSalesDetail,
		cancelGoodsWithdraw
	} from '@/api'
	import {
		userefundStore
	} from '@/store'
	const refundStore = userefundStore()
	const order_info_id = ref(0)
	const remainingTime = ref(0)
	const timeData = ref('')
	const info = ref({})
	const onChange = (e) => {
		timeData.value = e
	}

	const onFinish = () => {
		//倒计时结束
	}
	
	const goLogistics = () => {
		uni.navigateTo({
			url:'/pages-home/market/return_logistics?delivery_id='+info.value.refund_express_id+'&freight_no='+info.value.refund_express+'&refund_express_name='+info.value.refund_express_name
		})
	}
	const copyOrderNo = () => {
		uni.setClipboardData({
			data: info.value.order_no,
			success: function() {
				uni.showToast({
					title: '复制成功',
					icon: 'none'
				})
			}
		})
	}

	onLoad(async (option) => {
		order_info_id.value = option.order_info_id
		info.value = (await getGoodsAfterSalesDetail({
			order_info_id: order_info_id.value
		})).result
	})
	
</script>

<style lang="scss" scoped>
    .price_row {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 20upx 0;
		border-bottom: 1px solid #f0f0f0;
	}

	.price {
		font-size: 48upx;
		font-weight: bold;
		color: #333;
	}
	
	.price1 {
		font-size: 36upx;
		font-weight: bold;
		color: #333;
	}

	.pay_row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20upx 0;
		border-bottom: 1px solid #f0f0f0;
	}
	
	.pay_row:last-child {
		border-bottom: none;
	}
	
	.pay_lbl {
		font-size: 28upx;
		color: #979797;
	}
	
	.pay_val {
		font-size: 28upx;
		color: #333;
	}
	
	.cgreen {
		color: #52c41a;
	}
	
	.status_tip {
		font-size: 32upx;
	}
	
	.f600 {
		font-weight: 600;
	}

	.f24 {
		font-size: 24upx;
	}

	.c97 {
		color: #979797;
	}

	.thumb {
		width: 100upx;
		height: 100upx;
		border-radius: 6upx;
		margin-right: 20upx;
		margin-bottom: 20upx;
	}

	.skus {
		.pName {
			font-size: 26upx;
			color: #333;
		}

		.tags {
			background: #F2F2F2;
			color: #333;
			display: inline-flex;
			border-radius: 6upx;
			font-size: 24upx;
			padding: 4upx 15upx;
		}
	}

	

	.padding2 {
		padding: 0 30upx;
	}

	.btn_comm {
		margin-top: 20upx;
		width: 100%;
		height: 80upx;
		line-height: 80upx;
		border-radius: 6upx;
		font-size: 28upx;
		background-color: #fff;
		color: #ff0000;
		border: #ff0000 1px solid;
	}

	.ass-page {
		background-color: #f7f7f7;
		min-height: 100vh;
		padding-bottom: 80px;
	}

	.margin10 {
		margin: 10px 0;
	}

	.content {
		padding-top: 10px;

		.box {
			background-color: #fff;
			padding: 10px;

			.order-info {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin: 4px 0;
			}

			.order-info1 {
				display: flex;
				align-items: center;
				margin: 4px 0;
			}

			.orderNo {
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 24upx;
			}

			.lbl_pay {
				font-size: 24upx;
				color: #979797;
			}

			.pay_info {
				flex: 1;
				text-align: left;
				font-size: 24upx;
			}
		}
	}
	
	/* 物流时间轴样式 */
	.logistics-timeline {
		position: relative;
		padding: 20px;
		background-color: #fff;
	}
	
	.timeline-item {
		position: relative;
		padding-bottom: 20px;
	}
	
	.timeline-node {
		position: absolute;
		left: -10px;
		top: 5px;
		width: 12px;
		height: 12px;
		border-radius: 50%;
		background-color: #d9d9d9;
		z-index: 1;
	}
	
	.timeline-node.active {
		background-color: #52c41a;
	}
	
	.timeline-item:not(:last-child)::after {
		content: '';
		position: absolute;
		left: -4px;
		top: 17px;
		bottom: 0;
		width: 2px;
		background-color: #d9d9d9;
	}
	
	.timeline-content {
		margin-left: 15px;
	}
	
	.logistics-header {
		display: flex;
		justify-content: space-between;
		margin-bottom: 8px;
	}
	
	.status-text {
		font-weight: bold;
		color: #333;
	}
	
	.status-text.active {
		color: #52c41a;
	}
	
	.time-text {
		font-size: 12px;
		color: #999;
	}
	
	.logistics-detail {
		font-size: 14px;
		color: #666;
		line-height: 1.5;
	}
</style>